﻿/// <reference path="utils.js" />
'use strict';

//this main file will be the first one that's executed when the page loads, 
//it depends from app.js that it's gonna be available to use (or should be, adding it app to the require.js loader)
//app.js returns a global object that contains some stuff that's needed throughout the application.

require([
], function () {
    var initialRoute = $.trim(window.location.hash.replace('#', ''));

    //Start Backbone history api.
    Backbone.history.start({
        root: App.config.get('root'),
        hashChange: true,
        pushState: false,
    });


    //Push initial route.
    if (initialRoute.length == 0)
        App.router.route(App.config.get('defRoute'));
    else
        App.router.route(initialRoute);
});